<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ include file="/sys/include/header.jsp" %>
<%@ page import="java.util.*, com.es.common.*"%>
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
	<link href="sys/style01/css/table.css" rel="stylesheet" type="text/css" />
	<link href="sys/css/banzu.css" rel="stylesheet" type="text/css"  >
<%   
  //设置缓存为空   
  response.setHeader("Pragma","No-cache");   
  response.setHeader("Cache-Control","no-cache");   
  response.setDateHeader("Expires",   0); 
	CommonTypeBean cmnType = new CommonTypeBean();
	HashMap<String, String> typeMap = cmnType.getCommonType();
	String type;
	String key = "";
	String item_id="";
  %>

<script type="text/javascript">

function save()
{			
 		if(document.form1.cmn_code.value=="")
		{
				alert("请输入编码!");
		}else if(document.form1.cmn_value.value==""){
			alert("请输入名称!");
		}else if(document.form1.cmn_type.value==""){
			alert("请选择类型!");
			}
		else
		{
			document.form1.submit();
		}	
}

//获取类型
function selectitem(el)
{
	document.form1.cmn_type.value=el;
}


</script>

 </HEAD>

 <BODY class="ridgeBody">
 

 
 
  

<form name="form1" method="post" action="jsp/common/commoninsert.action">

  <table class=datatable width=50% cellpadding='0' cellspacing='0' border='1' bordercolorDark='white' bordercolorLight='#BEBEBE' >
      <!--DWLayoutTable-->
      <tr >
        <TD height="28" colspan="2" valign="top" class="dataTitle">添加Common信息</TD>
    </tr>

       <tr>
        <TD width=30% height="22" valign="top" nowrap class="datatr1">选择类型<font color="#FF0000">*</font>：</TD>
	
	    <TD width="184" valign="top" nowrap >
	
        <select name="cmn_type" class="input" onChange="selectitem(this.options[selectedIndex].value)">
          <option value="" selected>选择项目</option> 
          <%
			  	for(Iterator it = typeMap.keySet().iterator();it.hasNext();)
			  	{
			  		key =  it.next().toString();
			  		type = typeMap.get(key);
			%>
			  		 <option value="<%=key%>"><%=type%></option> 
         <%} %>	
			  		
          </select> 
         
           
       	</TD>
 	</tr>
 	
      <tr>
        <TD height="22" valign="top" nowrap class="datatr1">编码<font color="#FF0000">*</font>：</TD>	
	<TD valign="top" nowrap > 
	      <input name="cmn_code" type="text" class="input" /> 	</TD>
 	 </tr>
 	 
 	       <tr>
        <TD height="22" valign="top" nowrap class="datatr1">名称<font color="#FF0000">*</font>：</TD>	
	<TD valign="top" nowrap > 
	      <input name="cmn_value" type="text" class="input" /> 	</TD>
 	 </tr>
      
      <tr >
        <TD height="21" colspan="2" class="dataTitle">  <input type="button" name="Submit1" value="提交" onClick="save()"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	      <input type="reset" name="Input" value="重置" /></TD>
	</tr>
	  <%	
        if(request.getAttribute("message")!=null)
        {
        	String message=request.getAttribute("message").toString();
        %>
     	 
     	 <tr>
     	   <td height="2" colspan="4" valign="top"><%=message%></td>

   	   </tr>
     	 
     	 
  		 <%}%>
    </table>
  
</form>

 </BODY>
</HTML>